package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.dao.RclassDao;
import com.entity.RuleClass;

@Component
public class RuleClassPR {

	@Autowired
	private RclassDao ruleClassDao;

	@DataProvider
	public List<RuleClass> loadRuleClassParent() {
		return ruleClassDao.loadRuleClassParent();
	}

	@DataProvider
	public List<RuleClass> loadRuleClassChild(String parentId) {
		return ruleClassDao.loadRuleClassChild(parentId);
	}

	@Expose
	public boolean checkRuleClassHaveChild(String id) {
		return ruleClassDao.checkRuleClassHaveChild(id);
	}

	@DataResolver
	public void save(List<RuleClass> ruleClass) {
		ruleClassDao.saveClass(ruleClass);

	}
}
